﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PlanB.ShareDove.ConferenceOrganization.BusinessLayer.DataLayerInterface;
using PlanB.ShareDove.ConferenceOrganization.BusinessLayer.DataLayerInterface.Entities;

namespace PlanB.ShareDove.ConferenceOrganization.DataLayer.MockDataLayer
{
    /// <summary>
    /// Mock the datalayer
    /// </summary>
    public class MockDataLayer : IConferenceOrganizationDataLayerInterface
    {
        /// <summary>
        /// Get list of sessions, filtered by the session day, track and speaker
        /// Leave nulls in those parameters where you don't want any filtering
        /// </summary>
        /// <param name="context">not used</param>
        /// <param name="day">Day when the session is occuring</param>
        /// <param name="trackId">Id of the track to which the session belong</param>
        /// <returns>IEnumerable List of sessions</returns>
        public IEnumerable<ConferenceSession> GetSessionData(object context, DateTime? day, int? trackId)
        {
            List<ConferenceSession> sessions = new List<ConferenceSession>();


            ConferenceTrack devTrack = new ConferenceTrack() {Id=1, Name="DEV", Description="Development Track", Products="SharePoint, Visual Studio", CreatedAt=DateTime.Now, ModifiedAt=DateTime.Now, CreatedBy="MockUser", ModifiedBy="MockUser", Version=1};
            ConferenceRoom confRoom = new ConferenceRoom { Id = 1, Name = "Room 1", Address = "First floor", CreatedAt = DateTime.Now, ModifiedAt = DateTime.Now, CreatedBy = "MockUser", ModifiedBy = "MockUser", Version = 1 };
            ConferenceParticipant Speaker1 = new ConferenceParticipant { Id = 1, Name = "John Smith", HotelCostsCovered=true, IsBeingPaidForParticipation=false, IsJournalist=false, IsPartner=true, IsPaying=false, IsSpeaker=true, IsVisitor=true, IsSponsor=false, Sex= ConferenceOrganizationSolutionEnums.PersonSex.Male, TravelingCostsCovered=true,  CreatedAt = DateTime.Now, ModifiedAt = DateTime.Now, CreatedBy = "MockUser", ModifiedBy = "MockUser", Version = 1 };
            ConferenceParticipant Speaker2 = new ConferenceParticipant { Id = 2, Name = "John Doe", HotelCostsCovered = true, IsBeingPaidForParticipation = false, IsJournalist = false, IsPartner = true, IsPaying = false, IsSpeaker = true, IsVisitor = true, IsSponsor = false, Sex = ConferenceOrganizationSolutionEnums.PersonSex.Male, TravelingCostsCovered = true, CreatedAt = DateTime.Now, ModifiedAt = DateTime.Now, CreatedBy = "MockUser", ModifiedBy = "MockUser", Version = 1 };


            ConferenceSession session1 = new ConferenceSession();
            session1.Id = 1;
            session1.Title = "Session 1 Title";
            session1.Abstract = "Session 1 Abstract";
            session1.Track = devTrack;
            session1.Slot = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 15, 00, 00);
            session1.Duration = 45;
            List<ConferenceParticipant> confSpeakers1 = new List<ConferenceParticipant>();
            confSpeakers1.Add(Speaker1);
            session1.Speakers = confSpeakers1;
            session1.Language = "EN";
            session1.Level = "100";
            session1.CreatedAt = DateTime.Now;
            session1.ModifiedAt = DateTime.Now;
            session1.CreatedBy = "MockUser";
            session1.ModifiedBy = "MockUser";
            session1.Version = 1;

            sessions.Add(session1);

            ConferenceSession session2 = new ConferenceSession();
            session2.Id = 2;
            session2.Title = "Session 2 Title";
            session2.Abstract = "Session 2 Abstract";
            session2.Track = devTrack;
            session2.Slot = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 16, 00, 00);
            session2.Duration = 45;
            List<ConferenceParticipant> confSpeakers2 = new List<ConferenceParticipant>();
            confSpeakers2.Add(Speaker2);
            session2.Speakers = confSpeakers2;
            session2.Language = "EN";
            session2.Level = "100";
            session2.CreatedAt = DateTime.Now;
            session2.ModifiedAt = DateTime.Now;
            session2.CreatedBy = "MockUser";
            session2.ModifiedBy = "MockUser";
            session2.Version = 1;

            sessions.Add(session2);


            ConferenceSession session3 = new ConferenceSession();
            session3.Id = 3;
            session3.Title = "Session 3 Title";
            session3.Abstract = "Session 3 Abstract";
            session3.Track = devTrack;
            session3.Slot = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 17, 00, 00);
            session3.Duration = 45;
            List<ConferenceParticipant> confSpeakers3 = new List<ConferenceParticipant>();
            confSpeakers3.Add(Speaker1);
            confSpeakers3.Add(Speaker2);
            session3.Speakers = confSpeakers3;
            session3.Language = "EN";
            session3.Level = "100";
            session3.CreatedAt = DateTime.Now;
            session3.ModifiedAt = DateTime.Now;
            session3.CreatedBy = "MockUser";
            session3.ModifiedBy = "MockUser";
            session3.Version = 1;

            sessions.Add(session3);

            return sessions;

        }
    }
}
